import axios from 'axios';

// 文件列表
export function getFileList(params) {
  return axios({
    url: `/admin/drivefile/list`,
    method: 'get',
    params,
  });
}

export function fileRename(params) {
  return axios({
    url: `/admin/drivefile/update`,
    method: 'post',
    data: params,
  });
}

export function fileDelete(params) {
  return axios({
    url: `/admin/drivefile/delete`,
    method: 'post',
    data: params,
  });
}

/**
 * 文件夹管理
 * @param params
 */
export function getFolderList(params) {
  return axios({
    url: `/admin/drivefolder/list`,
    method: 'get',
  });
}

export function getFolderTree() {
  return axios({
    url: `/admin/drivefolder/treeList`,
    method: 'get',
  });
}

// 创建分类
export function folderCreate(params) {
  return axios({
    url: `/admin/drivefolder/create`,
    method: 'post',
    data: params,
  });
}

// 更新分类
export function folderUpdate(params) {
  return axios({
    url: `/admin/drivefolder/update`,
    method: 'post',
    data: params,
  });
}

// 删除分类
export function folderDelete(params) {
  return axios({
    url: `/admin/drivefolder/delete`,
    method: 'post',
    data: params,
  });
}
